import objectBase
from constant import *

class ZombieBase(objectBase.ObjectBase):
    def __init__(self,surface,path,size,pos,speed,gap,life) :
        self.speed = speed
        self.gap = gap
        self.surface = surface
        self.startLife = life
        self.life = life
        super().__init__(path,size,pos)

    def move(self):
        self.draw(self.surface)
        if self.speed[0] != 0:
            self.moveX(self.speed[0])
        if self.speed[1] != 0:
            self.moveY(self.speed[1])
        self.updateFileIndex(self.gap)

    def fight(self,life):
        self.life -= life

    def is_dead(self):
        return self.life <= 0
